package serviceImpl;

import java.util.ArrayList;

import dao.ForumDao;
import daoImpl.ForumDaoImpl;
import pojo.Answer;
import pojo.AnswerComment;
import pojo.Article;
import pojo.ArticleComment;
import pojo.Question;
import pojo.Resource;
import pojo.ResourceComment;
import service.ForumService;

public class ForumServiceImpl implements ForumService{
	
	
	
	
	@Override
	public boolean updateAnswerNumByqid3(int aid, int aCommentNum) {
		ForumDao f = new ForumDaoImpl();
		return f.updateAnswerNumByqid3(aid,aCommentNum);
	}

	@Override
	public boolean updateAnswerNumByqid2(int aid, int aReportNum) {
		ForumDao f = new ForumDaoImpl();
		return f.updateAnswerNumByqid2(aid,aReportNum);
	}

	@Override
	public Answer getAnswerNumByqid(int aid) {
		ForumDao f = new ForumDaoImpl();
		return f.getAnswerNumByqid(aid);
	}

	@Override
	public boolean updateAnswerNumByqid1(int aid, int aForkNum) {
		ForumDao f = new ForumDaoImpl();
		return f.updateAnswerNumByqid1(aid,aForkNum);
	}
	
	@Override
	public boolean updateAnswerNumByqid(int aid, int aLoveNum) {
		ForumDao f = new ForumDaoImpl();
		return f.updateAnswerNumByqid(aid,aLoveNum);
	}

	@Override
	public Question getFocusNumByqid(int qid) {
		ForumDao f = new ForumDaoImpl();

		return f.getFocusNumByqid(qid);
	}

	@Override
	public boolean updateFocusNumByqid(int qid, int qFocusNum02) {
		ForumDao f = new ForumDaoImpl();
		return f.updateFocusNumByqid(qid,qFocusNum02);
	}

	@Override
	public ArrayList<Resource> queryResourceByTitle(String resource) {
		ForumDao f = new ForumDaoImpl();
		ArrayList<Resource> resources = f.queryResourceByTitle(resource);
		return resources;
	}

	@Override
	public ArrayList<Article> queryArticleByTitle(String article) {
		ForumDao f = new ForumDaoImpl();
		ArrayList<Article> articles = f.queryArticleByTitle(article);
		return articles;
	}

	@Override
	public ArrayList<Question> queryQuestionByTitle(String question){
		ForumDao f = new ForumDaoImpl();
		ArrayList<Question> questions =f.queryQuestionByTitle(question);
		return questions;
	} 

	@Override
	public ArrayList<Question> getAllQuestion() {
		ForumDao f = new ForumDaoImpl();
		ArrayList<Question> qList = f.getAllQuestion();
		return qList;
	}

	@Override
	public ArrayList<Answer> getAnswerByqid(int qid) {
		ForumDao f = new ForumDaoImpl();
		ArrayList<Answer> aList = f.getAnswerByqid(qid);
		return aList;
	}

	@Override
	public ArrayList<AnswerComment> getAnswerComment(int aid) {
		ForumDao f = new ForumDaoImpl();
		ArrayList<AnswerComment> acList = f.getAnswerComment(aid);
		return acList;
	}

	@Override
	public ArrayList<Article> getAllArticle() {
		ForumDao f = new ForumDaoImpl();
		ArrayList<Article> artList = f.getAllArticle();
		return artList;
	}

	@Override
	public ArrayList<ArticleComment> getArticleComment(int artid) {
		ForumDao f = new ForumDaoImpl();
		ArrayList<ArticleComment> artcList = f.getArticleComment(artid);
		return artcList;
	}

	@Override
	public ArrayList<Resource> getAllResource() {
		ForumDao f = new ForumDaoImpl();
		ArrayList<Resource> rsList = f.getAllResource();
		return rsList;
	}

	@Override
	public ArrayList<ResourceComment> getResourceComment(int rsid) {
		ForumDao f = new ForumDaoImpl();
		ArrayList<ResourceComment> rscList = f.getResourceComment(rsid);
		return rscList;
	}

	@Override
	public int sendAcComment(int aid, int userid, String acComment) {
		ForumDao f = new ForumDaoImpl();
		int suc = f.sendAcComment(aid,userid,acComment);
		return suc;
	}

	@Override
	public int sendArtcComment(int artid, int userid, String artcComment) {
		ForumDao f = new ForumDaoImpl();
		int suc = f.sendArtcComment(artid,userid,artcComment);
		return suc;
	}

	@Override
	public int sendRscComment(int rsid, int userid, String rscComment) {
		ForumDao f = new ForumDaoImpl();
		int suc = f.sendRscComment(rsid,userid,rscComment);
		return suc;
	}

	@Override
	public int subQuestion(String title, int userid, String content) {
		ForumDao f = new ForumDaoImpl();
		int suc = f.subQuestion(title,userid,content);
		return suc;
	}

	@Override
	public int subExperience(String title, int userid, String content) {
		ForumDao f = new ForumDaoImpl();
		int suc = f.subExperience(title,userid,content);
		return suc;
	}

	@Override
	public int subResource(String title, int userid, String content) {
		ForumDao f = new ForumDaoImpl();
		int suc = f.subResource(title,userid,content);
		return suc;
	}

}
